package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TWarehouseMapper;
import com.ruoyi.business.domain.TWarehouse;
import com.ruoyi.business.service.ITWarehouseService;

/**
 * 仓库管理Service业务层处理
 *
 * @author 陈捷
 * @date 2024-11-19
 */
@Service
public class TWarehouseServiceImpl implements ITWarehouseService
{
    @Autowired
    private TWarehouseMapper tWarehouseMapper;

    /**
     * 查询仓库管理
     *
     * @param warehouseId 仓库管理主键
     * @return 仓库管理
     */
    @Override
    public TWarehouse selectTWarehouseByWarehouseId(Long warehouseId)
    {
        return tWarehouseMapper.selectTWarehouseByWarehouseId(warehouseId);
    }

    /**
     * 查询仓库管理列表
     *
     * @param tWarehouse 仓库管理
     * @return 仓库管理
     */
    @Override
    public List<TWarehouse> selectTWarehouseList(TWarehouse tWarehouse)
    {
        return tWarehouseMapper.selectTWarehouseList(tWarehouse);
    }

    /**
     * 新增仓库管理
     *
     * @param tWarehouse 仓库管理
     * @return 结果
     */
    @Override
    public int insertTWarehouse(TWarehouse tWarehouse)
    {
        tWarehouse.setCreateTime(DateUtils.getNowDate());
        return tWarehouseMapper.insertTWarehouse(tWarehouse);
    }

    /**
     * 修改仓库管理
     *
     * @param tWarehouse 仓库管理
     * @return 结果
     */
    @Override
    public int updateTWarehouse(TWarehouse tWarehouse)
    {
        tWarehouse.setUpdateTime(DateUtils.getNowDate());
        return tWarehouseMapper.updateTWarehouse(tWarehouse);
    }

    /**
     * 批量删除仓库管理
     *
     * @param warehouseIds 需要删除的仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteTWarehouseByWarehouseIds(Long[] warehouseIds)
    {
        return tWarehouseMapper.deleteTWarehouseByWarehouseIds(warehouseIds);
    }

    /**
     * 删除仓库管理信息
     *
     * @param warehouseId 仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteTWarehouseByWarehouseId(Long warehouseId)
    {
        return tWarehouseMapper.deleteTWarehouseByWarehouseId(warehouseId);
    }
}
